package algo_lignes_sites.data.force;

public class Force{
	
	public double dx;
	public double dy;

	public Force () {
		dx=0;
		dy=0;
	}

	public Force (double dx, double dy) {
		this.dx = dx;
		this.dy = dy;
	}

	public void setForce(double dx, double dy) {
		this.dx = dx;
		this.dy = dy;
	}

	public void clear() {
		dx=0;
		dy=0;
	}

	public void add(double dx, double dy) {
		this.dx += dx;
		this.dy += dy;
	}
	
	public void multiplyBy (double facteur) {
	    this.dx *= facteur;
	    this.dy *= facteur;
	}

	public double getAmplitude() {
		return Math.sqrt(dx*dx + dy*dy);
	}
	
}
